﻿using System.Diagnostics.Contracts;

namespace Library.Collections.Generic
{
    public interface ILinkedListNodePrevious<out TNode>
    {
        [Pure]
        TNode Previous { get; }
    }

    public interface ILinkedListNodePrevious<out TNode, out TEdge>
        where TEdge : IEdgeFrom<TNode>
    {
        [Pure]
        TEdge Previous { get; }
    }

    public interface ILinkedListNodeNext<out TNode>
    {
        [Pure]
        TNode Next { get; }
    }

    public interface ILinkedListNodeNext<out TNode, out TEdge>
        where TEdge : IEdgeTo<TNode>
    {
        [Pure]
        TEdge Next { get; }
    }

    public interface ILinkedListNode<out TNode> : ILinkedListNodePrevious<TNode>, ILinkedListNodeNext<TNode> { }

    public interface ILinkedListNode<out TNode, out TEdge> : ILinkedListNodePrevious<TNode, TEdge>, ILinkedListNodeNext<TNode, TEdge>
        where TEdge : IEdgeFrom<TNode>, IEdgeTo<TNode> { }
}
